package cn.rubintry.bug.hunting.room

import androidx.room.Database
import androidx.room.RoomDatabase
import androidx.room.TypeConverters
import cn.rubintry.bug.hunting.pojo.ArticleModel
import cn.rubintry.bug.hunting.pojo.ArticleTagTable
import cn.rubintry.bug.hunting.pojo.HomeBackgroundModel
import cn.rubintry.bug.hunting.pojo.TagDataModel
import cn.rubintry.bug.hunting.room.converter.ArticleConverter
import cn.rubintry.bug.hunting.room.dao.ArticleTagDao
import cn.rubintry.bug.hunting.room.dao.HomeBackgroundDao
import cn.rubintry.bug.hunting.room.dao.TagDao

@Database(entities = [TagDataModel::class , HomeBackgroundModel::class , ArticleTagTable::class], version = 1)
@TypeConverters(ArticleConverter::class)
abstract class AppDatabase : RoomDatabase(){
    /**
     * 标签dao
     */
    abstract fun tagDao() : TagDao

    /**
     * 背景dao
     */
    abstract fun homeBackgroundDao(): HomeBackgroundDao

    /**
     * 文章dao
     */
    abstract fun articleTagDao(): ArticleTagDao
}